#include <assert.h>
#include <stdio.h>
#include "scorbot.h"

/*
  NOTE!! This is just a basic, simple outline that Greg and Joe 
  came up with. Feel free to modify as necessary
*/


/*
  Either edit image in place or return something new....
  whoever implements this can decide what's easiest.
*/
int pre_process(IplImage *image, IMAGE_TARGET target)
{
    if (target == BLOCK)
    {
	// Do whatever
    }
    else
    {
	ASSERT(target == AREA);
	// somethin else
    }

    return 0;    
}

poDesc_t *find_po(IplImage *image)
{
    poDesc_t *po = NULL;

    // blah blah

    return po;
}

/*
  Begin by stripping out unnecessary information. Further 
  processing needs to be done depending on whether target is
  a BLOCK or an AREA.
  Returns valid poDesc_t on success, else NULL
*/
poDesc_t *processImage(IplImage *image, IMAGE_TARGET target)
{
    /* 
       Begin by preprocessing image... different things
       are done based on target
       BLOCK:
           Everything but the top face of the block 
	   should be stripped. May assume that top face
	   has a unique color
       AREA:
           Area will be outlined with tape of known color.
	   Should strip out tape and everything outside of it
	   and then fill in the center with the color of
	   the block face
    */
    pre_process(image, target);

    /*
      Takes the remaining image and determines the center of the
      face, how far away it is, and the orientation. Convert
      this information to a poDesc_t describing this position
      with respect to the camera
    */
    return find_po(image);
}
